package com.yfq.springframework.support;

import com.yfq.springframework.beans.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 姚凤桥
 * @date 2023/1/8 17:09
 * @description
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    private final Map<String, Object> singletonMap = new HashMap<>();


    @Override
    public void registerSingletonBean(String beanName, Object bean) {
        singletonMap.put(beanName, bean);
    }

    @Override
    public Object getSingletonBean(String beanName) {
        return singletonMap.get(beanName);
    }

}
